package com.tianqi.modules.pms.controller;


import com.tianqi.common.api.CommonResult;
import com.tianqi.modules.pms.dto.request.ProvinceSelectRequestDTO;
import com.tianqi.modules.pms.dto.response.ProvinceSelectResponseDTO;
import com.tianqi.modules.pms.service.PmsProvinceSelectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 省份选择控制器
 * </p>
 *
 * @author rory
 * @since 2022-12-27
 */
@RestController
@RequestMapping("/pms/province")
public class PmsProvinceSelectController {

	@Resource
	private PmsProvinceSelectService pmsProvinceSelectService;

	/**
	 * 省份选择
	 *
	 * @param dto
	 * @return {@link int}
	 * @author zhangzedi
	 * @date 2022/12/27 23:09
	 */
	@PostMapping("/select")
	public CommonResult<Long> select(@RequestBody ProvinceSelectRequestDTO dto) {
		long a = pmsProvinceSelectService.select(dto);
		return CommonResult.success(a);
	}

	/**
	 * 查询热门身份
	 *
	 * @param
	 * @return
	 * @author zhangzedi
	 * @date 2022/12/27 23:13
	 */
	@GetMapping("/queryHotArea")
	public CommonResult<List<ProvinceSelectResponseDTO>> queryHotArea() {
		return CommonResult.success(pmsProvinceSelectService.queryHotArea());
	}
}

